package com.tzb.shirospringbootjsp.dao;

import com.tzb.shirospringbootjsp.entity.Perms;
import com.tzb.shirospringbootjsp.entity.Role;
import com.tzb.shirospringbootjsp.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserDAO {
    void save(User user);

    User findByUserName(String userName);

    /**
     * 根据用户名查询所有角色
     * @param username
     * @return
     */
    User findRolesByUserName(String username);

    /**
     * 根据角色id查询权限集合
     * @param id
     * @return
     */
    List<Perms> findPermsByRoleId(String id);

}
